﻿@using ZKEACMS
@using ZKEACMS.FormGenerator.Models
@using ZKEACMS.FormGenerator
@model FormData
@{
    Layout = ZKEACMS.Layouts.EmailLayout;
    string link = $"{hostOptionProvider.GetOrigin()}/admin/FormData/Edit/{Model.ID}";
    Func<string, string> L = localize.Get;
}
@inject ZKEACMS.IHostOptionProvider hostOptionProvider
@inject Easy.ILocalize localize
<div>
    <h3>
        @(Model.Form.Title)
    </h3>
    <table border="1" cellspacing="0" cellpadding="5" bgcolor="" style="border-color: #eee; ">
        <thead>
            <tr>
                <th>@L("Field")</th>
                <th>@L("Value")</th>
            </tr>
        </thead>
        <tbody>
            @for (int i = 0; i < Model.Form.FormFields.Count; i++)
            {
                <tr>
                    <td>
                        @Model.Form.FormFields[i].DisplayName
                    </td>
                    <td>
                        @Html.DisplayFieldValue(Model.Form.FormFields[i])
                    </td>
                </tr>
            }
        </tbody>
    </table>
    <br />
    @Html.EmailLinkButton(link, L("View"))
</div>